package com.Deome.Class13;

import java.util.Objects;

public class Students1 {
    private String name;
    private String sex;
    private int age;
    private boolean ture;

    public String tostring() {

        return "Student{" +
                "name='" + name + '\'' +
                ", sex='" + sex + '\'' +
                ", age=" + age +
                '}';

    }

    public Students1() {
    }

    public Students1(String name, String sex, int age) {
        this.name = name;
        this.sex = sex;
        this.age = age;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getSex() {
        return sex;
    }

    public void setSex(String sex) {
        this.sex = sex;
    }

    public int getAge() {
        return age;
    }

    public void setAge(int age) {
        this.age = age;
    }
    public int hashCode() {
        return Objects.hash(name, sex, age);
    }

    @Override
    public boolean equals(Object obj) {
        if(this==obj)return ture;
       if (obj==null||getClass()!=obj.getClass())return false;
       Students1 students1=(Students1) obj;
       return age==students1.age&&
               Objects.equals(name,students1.name)&&
               Objects.equals(sex,students1.sex);
    }
}
